package com.zzyl.controller.manager;

import com.zzyl.base.PageBean;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.DeviceDataPageReqDto;
import com.zzyl.entity.DeviceData;
import com.zzyl.service.DeviceDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@Api(tags = "Iot设备数据管理")
@RequestMapping("/device-data")
public class DeviceDataController {

    @Resource
    private DeviceDataService deviceDataService;

    @ApiOperation("分页查询设备中的数据")
    @GetMapping("/get-page")
    public ResponseResult<PageBean<DeviceData>> pageQueryDeviceData(DeviceDataPageReqDto dto){
        log.info("分页查询设备数据：{}",dto);
        PageBean<DeviceData> pageBean = deviceDataService.pageQueryDeviceData(dto);
        return ResponseResult.success(pageBean);
    }



}
